package com.qwz.example;
/**
* @Description: 属性作为终结符对应的解释器
* @Package com.qwz.example.ProprietaryTerminalExpression
* @author Qiuwuzhi
* @date 2019/12/27 10:32
* @version V1.0
*/
public class ProprietaryTerminalExpression extends ReadXmlExpression {
    /**
     * 属性的名字
     */
    private String propName;

    public ProprietaryTerminalExpression(String propName) {
        this.propName = propName;
    }

    @Override
    public String[] interpreter(Context context) {
        //直接获取最后的元素属性的值
        String[] ss = new String[1];
        ss[0] = context.getPreEle().getAttribute(this.propName);
        return ss;
    }
}
